<!--
*Author：富行天下团队
 
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/Cabinet/Cabinet.js此处编写
 -->
<template>
    <div>
        <view-grid
                   ref="grid"
                   :columns="columns"
                   :detail="detail"
                   :editFormFields="editFormFields"
                   :editFormFileds="editFormFields"
                   :editFormOptions="editFormOptions"
                   :searchFormFields="searchFormFields"
                   :searchFormFileds="searchFormFields"
                   :searchFormOptions="searchFormOptions"
                   :table="table"
                   :extend="extend">
        </view-grid>
    </div>
</template>

<script>
    import extend from "@/extension/Cabinet/Cabinet.js";
    import ViewGrid from "@/components/basic/ViewGrid.vue";
    var vueParam = {
        components: {
            ViewGrid
        },
        data() {
            return {
                table: {
                    key: 'id',
                    footer: "Foots",
                    cnName: '柜子管理',
                    name: 'Cabinet',
                    url: "/Cabinet/",
                    sortName: "createDate"
                },
                extend: extend,
                editFormFields: {cabinetName:'',cabinetBoard:'',cabinetCode:'',cabinetIp:'',cabinetNO:'',cabinetType:'',isAvailable:'',productid:'',merchantCode: "", merchantName: ""},
                editFormOptions: [
                    [
                        {field:'cabinetName',title:'柜子名称',type:'like'},
                        {field:'cabinetBoard',title:'柜子板号',type:'like'},],
                    [
                        {field:'cabinetCode',title:'编码',type:'text'},
                        {field:'cabinetIp',title:'柜子ip',type:'text'}],
                    [
                        {field:'cabinetNO',title:'柜子组号',type:'text'},
                        {field:'productid',title:'绑定产品',type:'select',dataKey:'Products',data:[]}
                    ],
                    [
                        {field:'cabinetType',title:'柜子类型',type:'select',dataKey:'cabinet_type',data:[]},
                        {field:'isAvailable',title:'是否可用',type:'radio',data: [{key:0,value:'否'},{key:1,value:'是'}]}
                    ],
                
                    
                ],
                searchFormFields: {cabinetName:''},
                searchFormOptions: [
                     [
                        {field:'cabinetName',title:'柜子名称',type:'text'},
                        {field:'cabinetBoard',title:'柜子板号',type:'text'},],
                ],
                columns: [{field:'cabinetBoard',title:'柜子板号',type:'string',width:220,align:'left',sortable:true,hidden:true},
                       {field:'cabinetCode',title:'编码',type:'string',width:220,align:'left'},
                       {field:'cabinetIp',title:'柜子ip',type:'string',width:220,align:'left'},
                       {field:'cabinetName',title:'柜子名称',type:'string',width:220,align:'left'},
                       {field:'cabinetNO',title:'柜子组号',type:'string',width:220,align:'left'},
                    //    {field:'cabinetStatus',title:'柜子状态',type:'string',width:220,align:'left'},
                       {field:'cabinetType',title:'柜子类型',type:'string',width:220,align:'left',bind: { key: "cabinet_type", data: [] }},
                       {field:'productid',title:'绑定产品',type:'string',width:220,align:'left',bind: { key: "Products", data: [] }},
                       {field:'createDate',title:'创建时间',type:'datetime',width:90,align:'left',sortable:true},
                       {field:'createID',title:'创建人ID',type:'int',width:90,hidden:true,align:'left'},
                       {field:'creator',title:'创建人',type:'string',width:180,align:'left'},
                       {field:'id',title:'id',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'},
                    //    {field:'isAvailable',title:'是否可用',type:'sbyte',width:90,align:'left'},
                       {field:'modifier',title:'修改人',type:'string',width:180,align:'left'},
                       {field:'modifyDate',title:'修改时间',type:'datetime',width:90,align:'left',sortable:true},
                       {field:'modifyID',title:'修改人ID',type:'int',width:90,hidden:true,align:'left'},
                       ],
                detail: {
                    cnName:"柜门管理",
                    columns: [
                       {field:'boxName',title:'柜门名称',type:'string',width:120,align:'left',edit: { type: "text", required: true }},
                       {field:'boxCode',title:'柜门编码',type:'string',width:120,align:'left',edit: { type: "text", required: true },},
                       {field:'boxLight',title:'柜门灯组',type:'string',width:120,align:'left',edit: { type: "text", required: true }},
                    //    {field:'cabinetID',title:'柜子id',type:'int',width:120,align:'left',edit: { type: "text", required: true }},
                    //    {field:'greenLightStatus',title:'绿灯状态',type:'string',width:120,align:'left',edit: { type: "text", required: true }},
                       {field:'id',title:'id',type:'int',width:120,hidden:true,readonly:true,require:true,align:'left'},
                    //    {field:'redLightStatus',title:'红灯状态',type:'string',width:120,align:'left',edit: { type: "text", required: true }}
                    ],
                    sortName: "id",
                    key:"id"
                }
            };
        }
    };
    export default vueParam;
</script>
